package com.sc.nft.admin.controller;

import com.sc.nft.config.fulu.model.dto.FuLuGoodsInfoDTO;
import com.sc.nft.config.fulu.model.dto.FuLuGoodsListDTO;
import com.sc.nft.config.fulu.model.dto.FuLuGoodsTemplateDTO;
import com.sc.nft.config.fulu.model.dto.FuLuOrderDirectDTO;
import com.sc.nft.config.fulu.model.request.FuLuGoodsInfoRequest;
import com.sc.nft.config.fulu.model.request.FuLuGoodsListRequest;
import com.sc.nft.config.fulu.model.request.FuLuGoodsTemplateRequest;
import com.sc.nft.config.fulu.model.request.FuLuOrderDirectRequest;
import com.sc.nft.helper.FuLuHelper;
import com.sc.nft.sup.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;
import java.util.List;

/**
 * @author liGen
 * @version 1.0
 * @date 2023/11/9 3:48 下午
 */
@Slf4j
@RequiredArgsConstructor
@RestController
@RequestMapping("/admin/fuLu")
@Api(tags = "福禄商品模块")
public class FuLuGoodsController {


    private final FuLuHelper fuLuHelper;


    @ApiOperation(value = "福禄商品商品列表", notes = "福禄商品商品列表", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
    @PostMapping(value = "/goodsList", produces = MediaType.APPLICATION_JSON_VALUE)
    public Result<List<FuLuGoodsListDTO>> fuLuGoodsList(@RequestBody FuLuGoodsListRequest request) {
        List<FuLuGoodsListDTO> fuLuGoodsList = fuLuHelper.getFuLuGoodsList(request);
        return Result.success(fuLuGoodsList);
    }

    @ApiOperation(value = "福禄商品商品详情", notes = "福禄商品商品详情", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
    @PostMapping(value = "/goodsInfo", produces = MediaType.APPLICATION_JSON_VALUE)
    public Result<FuLuGoodsInfoDTO> fuLuGoodsInfo(@RequestBody FuLuGoodsInfoRequest request) {
        FuLuGoodsInfoDTO fuLuGoodsInfo = fuLuHelper.getFuLuGoodsInfo(request);
        return Result.success(fuLuGoodsInfo);
    }

    @ApiOperation(value = "福禄商品商品模版", notes = "福禄商品商品模版", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
    @PostMapping(value = "/goodsTemplate", produces = MediaType.APPLICATION_JSON_VALUE)
    public Result<FuLuGoodsTemplateDTO> fuLuGoodsTemplate(@RequestBody FuLuGoodsTemplateRequest request) {
        FuLuGoodsTemplateDTO fuLuGoodsTemplate = fuLuHelper.getFuLuGoodsTemplate(request);
        return Result.success(fuLuGoodsTemplate);
    }

    @ApiOperation(value = "福禄直充下单", notes = "福禄直充下单", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
    @PostMapping(value = "/fuLuOrderDirect", produces = MediaType.APPLICATION_JSON_VALUE)
    public Result<FuLuOrderDirectDTO> fuLuOrderDirect(@RequestBody FuLuOrderDirectRequest request) {
        FuLuOrderDirectDTO fuLuOrderDirectDTO = fuLuHelper.fuLuOrderDirect(request);
        return Result.success(fuLuOrderDirectDTO);
    }
}
